#! /usr/bin/python
# -*- coding:UTF-8 -*-

import re

f = open("wordlist.txt", "r")
n = open("wordlist_nuevo.txt", "w")
pattern = re.compile("^\w+$")

while True:
    palabra = f.readline()
    if not palabra:
        break
    if pattern.match(palabra):
        if len(palabra) < 9:
            n.write(palabra)
f.close()
n.close()
